define("www/guide/city", ["./mod/city/select", "../../plugins/jquery.suggestion", "./mod/city/list"], function(a) {
	var b = "undefined" != typeof TU && TU.imageUrl ? TU.imageUrl : "http://static.liantu.cn/image/";
	a("./mod/city/select"),
		function() {
			a("../../plugins/jquery.suggestion"), $(".mod-bar .text").suggestion({
				url: "/search/pcc/",
				FieldName: "w",
				dataFormat: "json",
				get: function(a) {
					var b = a.target,
						c = a.data.data,
						d = Math.min(c.length, 10);
					if(b.empty(), !d) return b.append('<li class="nodata"><span>暂时不支持该目的地</span></li>'), !1;
					for(var e = 0; d > e; e++) {
						var f = c[e];
						b.append('<li data-text="' + f.name + '"><a href="javascript:;" data-id="' + f.pccid + '">' + f.name + (f.province ? "," + f.province : "") + "</a></li>")
					}
				}
			})
		}(), a("./mod/city/list")({
			imageUrl: b
		})
}), define("www/guide/mod/city/select", [], function() {
	$(".select").on({
		mouseover: function() {
			var a = $(this),
				b = a.find(".box"),
				c = a.find(".list");
			b.addClass("active"), c.addClass("list-active")
		},
		mouseout: function() {
			var a = $(this),
				b = a.find(".box"),
				c = a.find(".list");
			b.removeClass("active"), c.removeClass("list-active")
		}
	}), $(".select").on("click", "a", function() {
		var a = $(this),
			b = a.parents(".select"),
			c = a.parents(".list"),
			d = c.prev(),
			e = b.width();
		c.width(e + "px"), b.width(e + "px"), d.text(a.text()), b.removeClass("active"), c.removeClass("list-active")
	})
}), define("plugins/jquery.suggestion", [], function() {
	! function(a) {
		a.fn.suggestion = function(b, c) {
			"function" == typeof b ? (c = b, b = {}) : (b = b || {}, c = c || function() {});
			var d = {
					url: "",
					suggestionCls: "suggestion",
					activeCls: "active",
					FieldName: "word",
					parameter: {},
					dataFormat: "json",
					jsonpCallback: "data_callback",
					error: function() {},
					beforeSend: function() {},
					time: 500,
					cache: !0,
					get: function() {},
					select: function(a) {
						a.input.val(a.target.text())
					},
					showEvent: function() {},
					hideEvent: function() {}
				},
				e = a.extend({}, d, b),
				f = a(window),
				g = a(document);
			return this.each(function() {
				var b = a(this),
					d = b.parents("form"),
					h = b.parent(),
					i = {},
					j = a("<div class='" + e.suggestionCls + "'><ul></ul></div>").appendTo(h),
					k = j.find("ul"),
					l = k.find("li"),
					m = b.outerHeight(!0),
					n = b.outerWidth(!0),
					o = 0,
					p = -1,
					q = !1,
					r = !1,
					s = !1,
					t = {};
				d.css({
					position: "relative"
				}), b.prop({
					autocomplete: "off",
					disableautocomplete: !0
				}), "relative" != j.css("position") && j.css("position", "absolute"), j.hide();
				var u = function() {
						m = b.outerHeight(!0), n = b.outerWidth(!0), _top = b.position().top, _left = b.position().left, "absolute" == j.css("position") && j.css({
							top: _top + m + "px",
							left: _left + "px",
							width: n + "px"
						})
					},
					v = function(a) {
						switch(a.isPropagationStopped(), a.preventDefault(), a.keyCode) {
							case 13:
							case 38:
							case 40:
								break;
							default:
								D()
						}
					},
					w = function(a) {
						switch(a.isPropagationStopped(), a.keyCode) {
							case 13:
								z();
								break;
							case 38:
								q && (p > 0 ? p-- : p = l.length - 1, l.eq(p).addClass(e.activeCls).siblings().removeClass(e.activeCls), a.preventDefault());
								break;
							case 40:
								q && (p < l.length - 1 ? p++ : p = 0, l.eq(p).addClass(e.activeCls).siblings().removeClass(e.activeCls), a.preventDefault())
						}
					},
					x = function(a) {
						a.isPropagationStopped(), a.preventDefault(), D()
					},
					y = function(b) {
						b.isPropagationStopped();
						var c = a(this);
						p = c.index(), c.addClass(e.activeCls).siblings().removeClass(e.activeCls)
					},
					z = function() {
						var a = k.find("li." + e.activeCls);
						if(0 != a.length) {
							var c = {
								target: a,
								input: b
							};
							e.select(c), A()
						}
					},
					A = function() {
						q = !1, clearTimeout(o), j.hide(), e.hideEvent()
					},
					B = function() {
						q = !0, j.show(), e.showEvent(), u()
					},
					C = function(a) {
						if("loading" != a) {
							var b = {
								target: k,
								data: a
							};
							e.get(b), l = j.find("li"), r = l.length > 0, B()
						}
					};
				window[e.jsonpCallback] = function() {};
				var D = function() {
					q = !0, o = setTimeout(function() {
						if(q) {
							var c = a.trim(b.val());
							if(!c) return i.hide(), r = 0, !0;
							p = -1, e.parameter[e.FieldName] = c;
							var d = a.param(e.parameter);
							if(e.cache && t[e.url + "?" + d]) return C(t[e.url + "?" + d]), !0;
							t[e.url + "?" + d] = "loading";
							var f = {};
							if(f.url = e.url, f.data = e.parameter, f.dataType = e.dataFormat, e.cache && (f.cache = !0), e.jsonpCallback && (f.jsonpCallback = e.jsonpCallback), e.error && (f.error = e.error({
									target: k
								})), e.beforeSend) {
								var g = {
									target: k
								};
								f.beforeSend = e.beforeSend(g)
							}
							f.success = function(a) {
								t[e.url + "?" + d] = a, C(a)
							}, a.ajax(f)
						}
					}, e.time)
				};
				i.getIsShow = function() {
					return q
				}, i.getObj = function() {
					return j
				}, i.show = function() {
					B(), s = !0
				}, i.hide = function() {
					A()
				}, i.getHasdata = function() {
					return r
				}, b.on({
					keyup: v,
					keydown: w,
					input: x
				}), b.on("click", function() {
					var a = b.val();
					r && a && (B(), s = !0)
				}), k.on("click", "li", function() {
					z()
				}).on("mouseenter", "li", y), g.on("click", function() {
					s || i.hide(), s = !1
				}), f.resize(u), u(), c(i)
			})
		}
	}(jQuery)
}), define("www/guide/mod/city/list", [], function(a, b, c) {
	function d(a) {
		var b = $.extend({
				imageUrl: ""
			}, a),
			c = $(".box"),
			d = $(".data"),
			e = d.attr("data-type"),
			f = $('input[type="radio"]'),
			g = $('input[type="checkbox"]'),
			h = $(".more"),
			i = "/guide/cityjson/",
			j = {},
			k = $(".text"),
			l = $(".mod-sort").attr("data-id"),
			m = "daoyou" == d.attr("data-type") ? "1" : "2",
			n = {
				service_city_id: l,
				type: m,
				pagenum: 1
			},
			o = {
				showNodata: function(a) {
					var c = a.data.length;
					9 > c && 0 != c ? (h.before('<p class="no-more">没有更多了</p>'), h.removeClass("show")) : c > 9 ? ($(".no-more").remove(), h.addClass("show")) : 0 == c && (h.before('<div class="no-data"><img src="' + b.imageUrl + 'www/public/nodata.png" alt="这个城市暂时没有提供服务哦！"><br/>这个城市暂时没有提供服务哦！</div>'), h.removeClass("show"))
				},
				createList: function(a, b) {
					for(var c, f, g, h = 0, i = a.length, j = [], k = []; i > h; h++) {
						c = "M" == a[h].gender ? "man" : "woman", f = a[h].priceWithCar ? "含车" : "不含车", period = a[h].period.substr(2, 2), g = [], a[h].services && a[h].services.title && (-1 != a[h].services.title.indexOf(",") ? g = a[h].services.title.split(",") : g.push(a[h].services.title));
						for(var l = 0, m = g.length; m > l; l++) k.push("<span>" + g[l] + "</span>");
						g = k.join(""), k = [], j.push('<li class="J_blocklink"><a href="/' + e + "/" + a[h].id + '.html" target="_blank" class="pic"><img src="' + a[h].avatarhd + '" alt="" width="200" height="200"></a><p class="name"><span class="' + c + '">' + a[h].nickname + '</span></p><p class="add"><span>' + a[h].domicile + "，" + period + '后</span></p><div class="service">' + g + '</div><p class="info">' + a[h].description + '</p><div class="price"><span class="unit">￥<span>' + a[h].price + "</span>元/天</span>(" + f + ')</div><div class="ft"><p><span class="praise">好评率：' + a[h].rate + '%</span><span class="order">预约量：' + a[h].order_count + '</span><span class="nice">颜值：' + a[h].rate_goodlooks + "%</span></p></div></li>")
					}
					b ? d.empty().append(j.join("")) : d.append(j.join(""))
				}
			},
			p = {
				submit: function(a) {
					n.pagenum = 1;
					var b = a,
						c = b.attr("data-value"),
						d = b.attr("data-name"),
						e = b.attr("data-id");
					f.each(function() {
						var a = $(this).attr("data-name");
						$(this).attr("data-value") === c && a === d && ($(this).attr("checked", "true"), f.not($(this)).removeAttr("checked"), n[a] = c)
					});
					var h = [];
					g.each(function() {
						$(this).is(":checked") && h.push($(this).attr("data-value"))
					});
					var i = h.join(",");
					n.services = i, e && (n.domicile = e), $(".no-data").remove(), $(".no-more").remove(), this.ajax(n)
				},
				ajax: function(a) {
					var b = this,
						c = [],
						e = i + "?" + $.param(a);
					if(c.push($.param(a)), j[c]) {
						var f = j[c];
						return this.success(f), void 0
					}
					$.ajax({
						url: e,
						type: "GET",
						dataType: "json",
						beforeSend: function() {
							d.empty().append('<span class="loading"></span>'), $(".no-more").remove(), $(".no-data").remove()
						},
						success: function(a) {
							j[c] = a, b.success(a)
						}
					})
				},
				success: function(a) {
					a && a.status && (o.showNodata(a), o.createList(a.data, !0), $(".loading").remove())
				}
			};
		c.on("click", "a", function() {
			p.submit($(this))
		}), g.on("click", function() {
			p.submit($(this))
		}), k.on("focusout", function() {
			$(this).val() || (delete n.domicile, p.submit($(this)))
		}), h.on("click", "a", function() {
			$.ajax({
				url: "/guide/cityjson/",
				type: "GET",
				dataType: "json",
				data: $.extend(n, n.pagenum++),
				beforeSend: function() {
					h.before('<span class="loading"></span>')
				},
				success: function(a) {
					a.data.length < 9 && (h.before('<p class="no-more">没有更多了</p>'), h.removeClass("show")), o.createList(a.data, !1), $(".loading").remove()
				}
			})
		})
	}
	c.exports = d
});